{extend name='public/modal'}
{block name='content'}
<style type="text/css">
    .submit_btn{
         float: center;
  }
  .domeImg{width: 50%;margin-left: 20%;}
</style>
<form action="implode_data" class="layui-form layui-form-pane" id="mainForm" method="post" enctype="multipart/form-data">

    <form class="form-horizontal" id='addForm' action="add_banner" enctype="multipart/form-data">
						<input type="hidden" name="fileName" id="fileName" value="">
                        <div class="layui-form-item" style="margin-left: 18%;">
                            <div class="layui-upload-drag" id="test10">
							  <i class="layui-icon"></i>
							  <p>点击上传，或将文件拖拽到此处</p>
							</div>
                        </div>
						<p id="lu"></p>
                </div>

            <div class="layui-form-item">
                <div class="layui-input-block submit_btn" style="margin-left: 155px;">
                    <input id="addReset" type="reset" style="display: none" value="这个是Form清除" />
                    <button type="submit" class="layui-btn layui-btn-success">导入</button>
                </div>
            </div>
</form>
{/block}
{block name='js'}
<script type="text/javascript">
$(function(){
	w_ajaxSubmit($('#mainForm'))
	
  layui.use('upload', function(){
    var $ = layui.jquery
    ,upload = layui.upload;
	//拖拽上传
	upload.render({
		elem: '#test10'
		,url: 'upload_file'
		,exts: 'xlsx|xls'
		,accept: 'file'
		,field: 'files'
		,done: function(res){
		  if(res.code != '0'){
			layer.msg(res.msg);
		  }else{
		  console.log(res.data)
			$("#fileName").val(res.data.src)
			$("#lu").html(res.data.name)
		  }
		}
	});
  })
});
</script>
{/block}
